﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;


namespace BusinessLibrary.BLL
{
   public class Ville
    {
              
  # region var
        public int  Id { get; set; }
        public string Nom { get; set; }
        public int Distance { get; set; }
        public Gouvernorat gouvernorat { get; set; }  

        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Ville GetVilletById(int id)
        {
            return sqlVille.GetVilleById(id);
        }


        public static int deleteVille(int id)
        {
            return sqlVille.deletVille(id);
        }


        public static int SaveVille(Ville v)
        {
            int nbRow;
            if ((nbRow = sqlVille.updateVille(v)) > 0)
                return nbRow;
            else
                return sqlVille.insertVille(v);
        }
    }
        #endregion
    }

